package com.yiqi.liebang.feature.home.view.adapter;

import android.support.annotation.Nullable;
import android.text.TextUtils;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.suozhang.framework.framework.AM;
import com.yiqi.liebang.R;
import com.yiqi.liebang.entity.bo.HomeBo;
import com.yiqi.liebang.entity.bo.MenuBo;

import java.util.List;

public class MenuAdapter extends BaseQuickAdapter<HomeBo.AppClassifyBean, BaseViewHolder> {
    public MenuAdapter() {
        super(R.layout.item_home_menu);
    }

    @Override
    protected void convert(BaseViewHolder helper, HomeBo.AppClassifyBean item) {
        helper.setText(R.id.iv_home_menu_title, item.getClassify());
       if (TextUtils.isEmpty(item.getIcon())){
           AM.image().bind(item.getImageSrc(),helper.getView(R.id.iv_home_menu_logo));
       }else {
           AM.image().bind(item.getIcon(),helper.getView(R.id.iv_home_menu_logo));
       }
    }
}
